import base64

PHP_PROXY_ALL = ['8.212.159.27', '8.212.161.116', '8.220.132.182', '8.212.169.182', '8.212.178.55', '8.212.173.178', '8.220.132.136']
SGD_PROXY_ALL = ['8.219.170.162', '8.219.230.222', '8.219.191.84', '8.222.150.138', '47.236.7.233', '8.219.107.216', '8.219.56.252', '8.219.250.168']
MYR_PROXY_ALL = ['154.90.63.173', '154.90.63.247', '8.219.170.162', '8.219.230.222']
JPY_PROXY_ALL = ["103.76.131.118", "103.76.131.134"]
KRW_PROXY_ALL = ["154.90.63.173", "154.90.63.247"]
THB_PROXY_ALL = ['154.90.63.173', '154.90.63.247', '8.219.56.252', '8.219.250.168']
TWD_PROXY_ALL = ['213.210.4.113','213.210.4.180','213.210.4.80','213.210.4.81','108.165.145.74', "213.210.4.16", "213.210.4.104", "213.210.4.40", '108.165.145.161', '108.165.145.59', '108.165.145.9', '108.165.145.12', '213.210.4.217', '213.210.4.127', '108.165.145.178', '108.165.145.179', '108.165.145.190', '213.210.4.156']
IDR_PROXY_ALL = ['8.215.34.211', '8.215.32.150', '8.215.36.93', '8.215.30.12']
CNY_PROXY_ALL = ['47.239.43.78', '47.239.221.202', '47.83.20.246', '47.239.246.35', '47.239.221.3', '47.83.24.145', '47.239.19.56', '47.239.10.44', '47.239.219.79', '47.239.2.166', '47.239.2.210', '47.239.192.40', '47.239.206.63', '47.239.241.82', '47.239.244.106', '47.239.222.173']
HKD_PROXY_ALL = ["23.175.201.129", "23.175.201.44", "23.175.201.113", "23.175.201.210", "23.175.201.73", "23.175.201.115", "23.175.201.100"]


def gen_ssr_link(ip, port, password, method, protocol, obfs, remarks, group):
    password_encoded = base64.urlsafe_b64encode(password.encode('utf-8')).decode('utf-8').rstrip('=')
    remarks_encoded = base64.urlsafe_b64encode(remarks.encode('utf-8')).decode('utf-8').rstrip('=')
    group_encoded = base64.urlsafe_b64encode(group.encode('utf-8')).decode('utf-8').rstrip('=')
    ssr = 'ssr://' + base64.urlsafe_b64encode(
        f'{ip}:{port}:{protocol}:{method}:{obfs}:{password_encoded}/?remarks={remarks_encoded}&group={group_encoded}'.encode(
            'utf-8')).decode('utf-8').rstrip('=')
    # print('Gen ssr link:', ssr)
    return ssr

if __name__ == '__main__':
    pass
